<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="HandheldFriendly" content="true" />
    <meta name="MobileOptimized" content="320" />
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>h5-原生调用测试</title>
</head>
<body>
<H5>这是一个h5页面</H5>
<button type="button"  onclick="selectPictures()">选取图片</button>
<img id="img" width='100' height="100" src="img.png"/>
<br>
<button type="button"  onclick="selectVideos()">选取视频</button>
<video id="video" width='100' height="100" src="video.mp4" controls autoplay></video>
<br>
<br>
<br>
<button type="button"  onclick="downLoad()">文件下载</button>
<script type="text/javascript">
function displayVideo(filePath) {
document.getElementById("video").src = filePath;
}

function displayImg(filePath) {
document.getElementById("img").src = filePath;
}

function selectPictures(){ Android.jsCall('SELECT_MEDIA','{"mediaType":1,"maxSelectPicNum":2,"maxSelectVideoNum":0,"maxFileSize":20,"selectedList":[]}','displayImg'); }
function selectVideos(){ Android.jsCall('SELECT_MEDIA','{"mediaType":2,"maxSelectPicNum":1,"maxSelectVideoNum":1,"maxFileSize":30,"selectedList":[]}','displayVideo'); }
function downLoad(){ Android.jsCall('DOWN_LOAD','{"url":"https://www.erke.com/images/erker_logo.gif","fileName":"erker_logo.gif"}','downLoad'); }
</script>
</body>

</html>